package com.shen.jcbf.thread;

import java.util.concurrent.*;

/**
 * @author 怜笑
 * @company 公司
 * @create 2019-08-07 10:35
 */
public class TestThread3 implements Callable {

    @Override
    public Object call() throws Exception {
        return "12345";
    }

    public static void main(String[] args) throws ExecutionException {
        TestThread3 mMyTestCallable = new TestThread3();
        ExecutorService mExecutorService = Executors.newSingleThreadExecutor();
        Future mfuture = mExecutorService.submit(mMyTestCallable);

        try {
            //等待线程结束，并返回结果
            System.out.println(mfuture.get());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
